var login = document.querySelector("#login-panel")
var register = document.querySelector("#register-panel")
var cButtons = document.querySelectorAll(".login-change")
var title = document.querySelector(".modal-title")

var myModal = document.querySelector("#myModal");

myModal.panelchange = function () {
    console.log("change!")
    if (login.className === "hidden") {
        title.innerHTML = "登录"
        register.className = "hidden"
        login.className = ""
    } else {
        title.innerHTML = "注册"
        login.className = "hidden"
        register.className = ""
    }
}
myModal.showRegisterAlter = function (message){
    const alter = document.querySelector("#register_alter_control")
    alter.className = "show"
    alter.childNodes[1].innerHTML = message
}

for (let but in cButtons) {
    cButtons[but].addEventListener("click", myModal.panelchange)
}



